package com.example.sms.web;

import com.example.sms.config.Bus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SuppressWarnings("all")
@RestController
public class HelloController {

    @Autowired
    private Bus bus;

    @RequestMapping("/departments/{id}")
    public String deleteDepartment(@PathVariable Long id) {

        bus.post(new DeleteDepartmentCommand(id));

        return "sucess";
    }
}
